package resourcemanagement;

public interface ManagedResource<Resource> {
	/**
	 * loads the associated resource
	 * @require !isLoaded()
	 */
	public void load();
	
	/**
	 * Unloads the associated resource, the resource is not valid anymore after unloading
	 * 
	 * @require isLoaded()
	 * @ensure !isLoaded()
	 */
	public void unload();
	
	/**
	 * Checks if the associated resource has been loaded
	 * @return true if it is loaded
	 */
	public boolean isLoaded();
	
	/**
	 * Returns the associated resource
	 * @require isLoaded();
	 */
	public Resource getResource();
}
